package com.jishuo.nontax.bean.vo;

import com.jishuo.base.util.StringObject;
import com.jishuo.nontax.bean.bank.Illegalactivityinfo;
import com.jishuo.nontax.bean.message.SetIllegalactivityCrossPayInfo;
import com.jishuo.nontax.bean.message.SetIllegalactivityDetail;
import com.jishuo.nontax.bean.message.SetIllegalactivityinfo;
import com.jishuo.nontax.bean.message.SetPayinfo;
import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;

/**
 * @auther dinggaofei
 * @Date 2022/12/23 9:45
 * @tableName 交罚表
 */
@Data
public class IllegalactivityinfoVO {
    /**
     * 流水号
     */
    private Long iaiid;

    /**
     * 行政区划
     */
    private Long cantonid;

    /**
     * 执收单位
     */
    private Long unitid;

    /**
     * 决定书编号
     */
    private String billnum;

    /**
     * 违法时间
     */
    private String occurdatetime;

    /**
     * 处理时间
     */
    private String opterdatetime;

    /**
     * 驾驶证号
     */
    private String certificatenum;

    /**
     * 当事人
     */
    private String occurname;

    /**
     * 处罚交警大队代码
     */
    private String trafficunitnum;

    /**
     * 罚款金额
     */
    private BigDecimal funds;

    /**
     * 滞纳金
     */
    private BigDecimal latefee;

    /**
     * 信息状态：1原始记录2更新记录3删除记录
     */
    private Integer billstate;

    /**
     * 是否银行确认收款
     */
    private Integer isbankaffirm;

    /**
     * 银行收款时间
     */
    private String paybankdt;

    /**
     * 银行网点
     */
    private String bankstation;

    /**
     * 银行交易流水号
     */
    private String bankaffirm;

    /**
     * 专用票据编号
     */
    private String specialbillnum;

    /**
     * 代理银行ID
     */
    private Long bankid;

    /**
     * 是否需要向交管发送数据
     */
    private Integer ismodify;

    /**
     * 票据种类ＩＤ
     */
    private Long billtypeid;

    /**
     * 打印时间
     */
    private String writedate;

    /**
     * 是否异地
     */
    private Integer isnohere;

    /**
     * 是否开票
     */
    private Integer isspecialbill;

    /**
     * 是否分成0表示正常1表示分成
     */
    private Integer isscale;

    /**
     * 采集地交警大队代码
     */
    private String collectunitnum;

    /**
     * 采集地行政区划
     */
    private Long collectcantonid;

    /**
     * 分成金额
     */
    private BigDecimal collectfunds;

    /**
     *
     */
    private Integer issend;

    /**
     *
     */
    private Long messageid;

    /**
     * 缴款方式
     */
    private Integer payway;

    /**
     * 发送时间
     */
    private String sendtime;

    /**
     * 银行核心交易流水号
     */
    private String hxbankaffirm;

    /**
     *
     */
    private String paychannels;

    /**
     *
     */
    private String payregion;


    /**
     *
     */
    private Date entrydate;

    private BigDecimal localfunds;
    /**
     * 账户
     */
    private String accountcode;
    /**
     * 账户名称
     */
    private String accountname;
    /**
     * 银行名称名称
     */
    private String bankname;

    /**
     * 缴款方式编码
     */
    private String paywaycode;
    // 下面三个字段不存数据库
    /**
     * 付款人账户
     */
    private String payeeaccountnum;
    /**
     * 违法地址
     */
    private String breakaddress;
    /**
     * 备注
     */
    private String remark;
    /**
     * 交罚明细
     */
    //页面列表
    private BigDecimal remainfunds; //处罚地自留金额
    private String payeebankname;

    private String payeeaccountname;
    private String payeeaccountcode;

    private String collectcantoncode; //区划

    private String collectcantonname;//区划名称
    private String billid;
    private ArrayList<IllegalactivityDetailVO> detailVOS;

    private String paychnl;
    private String payeraccount;


    //返回Illegalactivityinfo类
    public Illegalactivityinfo getIllegalactivityInfo() {
        Illegalactivityinfo ill = new Illegalactivityinfo();
        ill.setBillstate(StringObject.objectString(this.billstate));
        ill.setBillnum(this.billnum);
        ill.setOccurdatetime(this.occurdatetime);
        ill.setOpterdatetime(this.opterdatetime);
        ill.setOccurname(this.occurname);
        ill.setTrafficunitnum(this.trafficunitnum);
        ill.setFunds(StringObject.objectString(this.funds));
        ill.setLatefee(StringObject.objectString(this.latefee));
        ill.setIsscale(StringObject.objectString(this.isscale));
        ill.setLocalfunds(StringObject.objectString(this.localfunds));
        ill.setCertificatenum(this.certificatenum);
        ill.setCollectunitnum(this.collectunitnum);
        ill.setColletcantonid(StringObject.objectString(this.collectcantonid));
        ill.setCollectfunds(StringObject.objectString(this.collectfunds));
        ill.setBankid(StringObject.objectString(this.bankid));
        ill.setAccountcode(this.accountcode);
        ill.setAccountname(this.accountname);
      /*  IllegalactivityDetailVO detailVO = new IllegalactivityDetailVO();
        ArrayList<IllegalactivityDetail> detail = detailVO.findDetail();
        ill.setDetail(detail);*/
        return ill;

    }

    //返回SetPayinfo
    public SetPayinfo setPayinfo() {
        SetPayinfo setPayinfo = new SetPayinfo();
        setPayinfo.setBillnum(this.billnum);
        setPayinfo.setBankid(StringObject.objectString(this.bankid));

        setPayinfo.setOccurname(this.occurname);
        setPayinfo.setFunds(StringObject.objectString(this.funds));
        setPayinfo.setLatefee(StringObject.objectString(this.latefee));
        setPayinfo.setIsnohere(StringObject.objectString(this.isnohere));
        setPayinfo.setIsspecialbill(StringObject.objectString(this.isspecialbill));
        setPayinfo.setSpecialbillnum(this.specialbillnum);
        setPayinfo.setPaybankdt(this.paybankdt);
        setPayinfo.setBankaffirm(this.bankaffirm);
        setPayinfo.setBankstation(this.bankstation);
        setPayinfo.setPaywayid(StringObject.objectString(this.payway));
        return setPayinfo;
    }

    public IllegalactivityinfoVO() {
    }

    //从SetIllegalactivityinfo中取数据
    public IllegalactivityinfoVO(SetIllegalactivityinfo info) {
        this.billnum = info.getBillnum();
        this.occurdatetime = info.getOccurdatetime();
        this.opterdatetime = info.getOpterdatetime();
        this.certificatenum = info.getCertificatenum();
        this.occurname = info.getOccurname();
        this.trafficunitnum = info.getTrafficunitnum();
        this.funds = new BigDecimal(info.getFunds());
        this.latefee = new BigDecimal(info.getLatefee());
        this.bankid = Long.parseLong(info.getBankid());
        this.isscale = Integer.parseInt(info.getIsscale());
        this.localfunds = new BigDecimal(info.getLocalfunds());
        this.collectunitnum = info.getCollectunitnum();
        this.collectcantonid = Long.parseLong(info.getColletcantonid());
        this.collectfunds = new BigDecimal(info.getCollectfunds());
        this.detailVOS = new ArrayList<>();
        ArrayList<SetIllegalactivityDetail> list = info.getDetail();
        for (SetIllegalactivityDetail detail : list) {
            IllegalactivityDetailVO detailVO = new IllegalactivityDetailVO(detail);
            detailVO.setBillnum(info.getBillnum());
            this.detailVOS.add(detailVO);
        }
    }
//返回SetIllegalactivityCrossPayInfo 对象
    public SetIllegalactivityCrossPayInfo setIllegalactivityCrossPayInfo(){

        SetIllegalactivityCrossPayInfo  setPayinfo = new SetIllegalactivityCrossPayInfo();
        setPayinfo.setBillnum(this.billnum);
        setPayinfo.setOccurdatetime(this.occurdatetime);
        setPayinfo.setOpterdatetime(this.opterdatetime);
        setPayinfo.setCertificatenum(this.certificatenum);
        setPayinfo.setOccurname(this.occurname);
        setPayinfo.setPayeeaccountnum(this.payeeaccountnum);
        setPayinfo.setTrafficunitnum(this.trafficunitnum);
        setPayinfo.setFunds(StringObject.objectString(this.funds));
        setPayinfo.setLatefee(StringObject.objectString(this.latefee));
        setPayinfo.setBankid(StringObject.objectString(this.bankid));
        setPayinfo.setPayregion(this.payregion);
        setPayinfo.setBreakaddress(this.breakaddress);
        setPayinfo.setPaychannels(this.paychannels);
        setPayinfo.setRemark(this.remark);
        setPayinfo.setPaybankdt(this.paybankdt);
        setPayinfo.setBankaffirm(this.bankaffirm);
        setPayinfo.setBankstation(this.bankstation);

        return setPayinfo;
    }
}
